package com.fjec.common.eventbus.event;

import com.fjec.common.util.DateUtil;
import lombok.Data;

import java.util.Date;
import java.util.Map;
import java.util.Objects;

@Data
public class VisitLogEvent {

    private String threadName;
    private String className;
    private String methodName;
    private Map<String, Object> argsMap;
    private Map<String, Object> userMap;
    private String argsJson;
    private Date happenTime;
    private Throwable throwable;
    private String throwableString;
    private String traceId;
    private Object result;
    private long useTime;

    @Override
    public String toString() {
        String strHappenTime = Objects.isNull(happenTime) ? "" : DateUtil.format(happenTime, "yyyy-MM-dd HH:mm:ss");
        return "ErrorLogEvent{" +
                "className='" + className + '\'' +
                ", methodName='" + methodName + '\'' +
                ", argsJson=" + argsJson +
                ", happenTime=" + strHappenTime +
                '}';
    }
}
